<template>
  <div class="rules-container">
    <div class="title">
      <h2>{{title}}</h2>
    </div>
    <div class="content">
      描述：
      <el-input
        class="textarea"
        type="textarea"
        :rows="2"
        placeholder="请输入内容"
        v-model="textarea">
      </el-input>
    </div>
    <el-button @click="handleSave">保存</el-button>
  </div>
</template>
<script>
export default {
  props: {
    title: String
  },
  data() {
    return{
      textarea: ''
    }
  },
  methods: {
    handleSave() {
      this.$emit('saveRules', this.textarea)
    }
  }
}
</script>
<style lang="scss" scoped>
.title{
  h2{
    font-size: 16px;
  }
}
.rules-container{
  padding: 20px;
  .textarea /deep/ .el-textarea__inner{
    width: 332px !important;
    height: 155px !important;
    margin-left: 10px;
  }
  .content{
    display: flex;
    white-space: nowrap;
    margin-left: 50px;
    margin-top: 27px;
  }
}
.el-button{
    width: 70px;
    height: 34px;
    line-height: 30px;
    border-radius: 6px;
    background-color: rgba(27, 166, 135, 1);
    color: rgba(16, 16, 16, 1);
    font-size: 14px;
    text-align: center;
    font-family: Roboto;
    color: #fff;
    padding: 0;
    margin-left: 110px;
    margin-top: 26px;
  }
</style>